﻿using UnityEngine;
using System.Collections;

public static class FileLog
{
    static string filePath;

    public static void Init(string _filePath)
    {
        if (filePath != null)
        {
            return;
        }

        filePath = _filePath;
        CommonUtil.Delete(filePath);
    }

    public static void Log(string log)
    {
        if (filePath == null || string.IsNullOrEmpty(log))
        {
            return;
        }

        System.IO.File.AppendAllText(filePath, "Log:" + System.DateTime.Now.ToShortDateString().ToString() + " " + System.DateTime.Now.TimeOfDay.ToString() + " @ " + Time.time + " @ " + Time.frameCount + " | " + log + "\n");
    }
}